package lormi.meipin.dto;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.validation.constraints.NotNull;

import lormi.meipin.exception.LMException;

/**
 * 培训经历添加接口   = 参数实体类
 * @author ThreeFeng
 * @date 2016年8月12日 下午5:33:28
 */
public class TrainedAddDto {
	
	private Integer userid;

	//培训学校
	@NotNull(message = "100033")
	private String schoolname;

	//培训等级（初级，中级，高级）
	@NotNull(message = "100033")
	private Integer education;

	//专业（自定义输入）
	@NotNull(message = "100033")
	private String positionclass;

	//培训开始时间
	@NotNull(message = "100033")
	private String begin;

	//培训结束时间
	@NotNull(message = "100033")
	private String end;

	
	
	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public String getSchoolname() {
		return schoolname;
	}

	public void setSchoolname(String schoolname) {
		this.schoolname = schoolname;
	}

	public Integer getEducation() {
		return education;
	}

	public void setEducation(Integer education) {
		this.education = education;
	}

	public String getPositionclass() {
		return positionclass;
	}

	public void setPositionclass(String positionclass) {
		this.positionclass = positionclass;
	}


	public String getBegin() throws LMException {
		return this.begin;
	}
	
	public Date getBeginForDate() throws LMException {
		try {
			return new SimpleDateFormat("yyyy-M-d").parse(getBegin());
		} catch (ParseException e) {
			throw new LMException();
		}
	}

	public void setBegin(String begin) {
		this.begin = begin;
	}

	public String getEnd(){
		return this.end;
	}
	
	public Date getEndForDate() throws LMException {
		try {
			return new SimpleDateFormat("yyyy-M-d").parse(getEnd());
		} catch (ParseException e) {
			throw new LMException();
		}
	}

	public void setEnd(String end) {
		this.end = end;
	}

	
	
}
